<script setup>

import {ref} from "vue";

const city = ref("hz");
</script>

<template>
<h1>下拉选框组件</h1>
<el-select v-model="city" placeholder="请选择城市" style="width: 40%;">
  <el-option label="北京" value="bj"></el-option>
  <el-option label="上海" value="sh"></el-option>
  <el-option label="广州" value="gz"></el-option>
  <el-option label="深圳" value="sz"></el-option>
  <el-option label="杭州" value="hz"></el-option>
  <el-option label="南京" value="nj"></el-option>
</el-select>
<h4>您选择的城市是:{{city}}</h4>
</template>

<style scoped>

</style>